package conf

import (
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

// AccountSection map toml [account]
type AccountSection struct {
	Host  string
	Port  string
}

// ReadAccount get account section from config
func ReadAccount(v *viper.Viper, slog *zap.SugaredLogger) (accountConf AccountSection) {
	err := v.Unmarshal(&accountConf)
	if err != nil {
		slog.Panicf("unable to decode into account section, %v", err)
	}
	slog.Debug(accountConf)
	return
}
